package com.falcon.tools.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class ParamInfo {

    /** 参数名 **/
    private String name;

    /** 参数类型 **/
    private Class classType;

    /** 参数类型: 0-do 1-List<DO> 2-Pager<DO> 3-ListRequest*/
    private int type = 0;

    /** 是否是路径参数 */
    private boolean pathParam;

    /** 是否有 @RequestBodyAnno 修饰*/
    private boolean hasRequestBodyAnno;

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        ParamInfo paramInfo = (ParamInfo) object;
        return Objects.equals(classType.getName(), paramInfo.classType.getName());
    }

    @Override
    public int hashCode() {
        return Objects.hash(classType);
    }
}
